﻿/* 
 * author: www.cnblogs.com/luminji
 * date  : 2012/01/16
 */
using System;
using System.Collections.Generic;
using System.Linq;

namespace Luminji.Core.Algorithm
{
    public sealed class RandomManager
    {
        public static int[] GetRandomInts(int count, int begin, int end)
        {
            var hashSet = new HashSet<int>();
            for (int i = 0; hashSet.Count < count; i++)
            {
                var random = new Random();
                hashSet.Add(random.Next(begin, end));
            }
            return hashSet.ToArray();
        }
    }
}
